package com.lakeworks.web.controller.ticket;



/**
 * 赔偿单Controller
 * 
 * @author ruoyi
 * @date 2023-08-16
 */

import com.lakeworks.common.core.controller.BaseController;
import com.lakeworks.common.core.domain.AjaxResult;
import com.lakeworks.common.core.page.TableDataInfo;
import com.lakeworks.common.domain.ticket.TktClaims;
import com.lakeworks.common.domain.ticket.TktClaimsRecord;
import com.lakeworks.service.ITktClaimsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

@RestController
@RequestMapping("/claims")
public class TktClaimsController extends BaseController
{

    @Autowired
    private ITktClaimsService tktClaimsService;

    /**
     * 获取工单售后信息列表
     * */
    @GetMapping("/list")
    public AjaxResult getClaimsList(TktClaims tktClaims){
        return success(tktClaimsService.selectTktClaimsList(tktClaims));
    }


    /**
     * 申请复议
     * */
    @PostMapping("/record")
    public AjaxResult addRecord(@RequestBody @Valid TktClaimsRecord tktClaimsRecord){
        return tktClaimsService.addRecord(tktClaimsRecord);
    }


    /**
     * 复议详情
     * */
    @GetMapping("/record")
    public AjaxResult getRecord(Long claimsId){
        return tktClaimsService.getRecord(claimsId);
    }


}
